namespace Backoffice.Domain.Entities.App;

/// <summary>
/// 用户角色关联表
/// </summary>
/// 
public class AppUserRole : EntityBase
{
    public Guid UserId { get; private set; }
    public Guid RoleId { get; private set; }

    // 导航属性
    public virtual AppUser User { get; private set; } = null!;
    public virtual AppRole Role { get; private set; } = null!;

    private AppUserRole() { }

    public AppUserRole(AppUser user, AppRole role)
    {
        User = user;
        Role = role;
        UserId = user.Id;
        RoleId = role.Id;
    }
}